package top.healthylife.gateway.platform.fh.dto.sheshui.businessquery.req;

import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.Getter;
import lombok.experimental.Accessors;
import top.healthylife.basics.utils.exception.BusinessException;
import top.healthylife.gateway.platform.fh.dto.sheshui.businessquery.res.FhResBusinessQuerySheShuiGJBDto;
import top.healthylife.gateway.platform.fh.dto.unify.req.FhReqBusinessQueryUnifyDto;

import java.util.Arrays;

/**
 * @author : GaoZeXi
 * @date 2021/11/1 11:52
 */
@Data
@Accessors(chain = true)
@ApiModel("涉税高精版-企业查询")
public class FhReqBusinessQuerySheShuiGJBDto extends FhReqBusinessQueryUnifyDto {

    @Override
    public void checkDataType(String dataType) {
        if (ObjectUtil.isNotEmpty(dataType)) {
            Arrays.stream(DataType.values()).filter(e -> e.toString().equals(dataType))
                    .findAny().orElseThrow(() -> new BusinessException("[企业查询-涉税高精版]入参的dataType不在期望值,期望的类型列表为:"+ Arrays.toString(DataType.values())));
        }
    }


    @ApiModel("企业查询-涉税高精版 数据类型")
    @Getter
    public enum DataType {
        /**
         * 具体意思查看 {@link  FhResBusinessQuerySheShuiGJBDto}
         */
        satparty_qs,
        satparty_chufa,
        satparty_fzc,
        satparty_xin,
        satparty_xuke,
        satparty_reg,
    }
}
